package com.kyh.util;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

public class ResponseUtil {
	
	private static final Logger logger = Logger.getLogger(ResponseUtil.class);
	
	public static void writeData(HttpServletResponse response, String data){
		PrintWriter pw = null;
		try{
			pw = response.getWriter();
			pw.write(data);
			pw.flush();
		} catch (IOException e) {
			logger.error("输出异常",e);
		} finally {
			if(pw != null){
				pw.close();
			}
		}
	}
	
}
